<?php

if(!$_COOKIE['flip_auth']) { 
	die();
} 

	include_once("../config.inc.php"); 
	include_once("../coreFX.inc.php"); 
	include_once("../ip.inc.php"); 
	include_once($cfile); 
	include_once($ffile); 
	include_once($afile);


$auth = unserialize(base64_decode($_COOKIE['flip_auth'])); 
$User = get_user_by_uid($auth['uid']); 
if($auth['Hash'] != trim($User['hash'])) {
	die("You are not logged in!"); 
} 

if($_SERVER['PHP_SELF']) { 
	$self = $_SERVER['PHP_SELF']; 
} elseif($HTTP_SERVER_VARS['PHP_SELF']) { 
	$self = $HTTP_SERVER_VARS['PHP_SELF'];
} else { 
	$self = $PHP_SELF;
}

if($_REQUEST['op'] == "tag") { 
    include("admin-ajax-tags.inc.php");
	exit; 
} elseif($_REQUEST['op'] == "topic") {
	$t = intval($_GET['topic']); 
	$id = intval($_GET['id']); 
	change_topic_ajax($id,$t); 	
	die("1"); 
} elseif($_REQUEST['op'] == "posts") { 
    include("admin-ajax-posts.inc.php");
	exit; 
} elseif($_REQUEST['op'] == "mkslug") { 
    include("admin-ajax-slug.inc.php");
	exit; 
} elseif($_REQUEST['op'] == "suggest") { 
    include("admin-ajax-tagsuggest.inc.php");
	exit; 
} elseif($_REQUEST['op'] == "uploads") { 
    include("admin-ajax-uploaddir.inc.php");
	exit; 
} else {
	die("0"); 
}

?>
